define(['vue','common'],function (Vue,common){
    const Controller = {
        index:function (){
            let {createApp} = Vue;
            let app = createApp({
                data(){
                    return {
                        form:{}
                    }
                },
                created(){
                    this.form = {
                        id:Config.user_info.id,
                        nickname:Config.user_info.nickname,
                        password:"",
                        avatar:Config.user_info.avatar,
                        email:Config.user_info.email,
                    }
                    console.log(this.form,'fffffffffffffffffff')
                },
                methods:{
                    ...common,
                    onSubmit(){
                        let url = Config.sub_url;
                        let that = this
                        common.postHandle(url,{row:common.copy(this.form)}).then(res=>{
                            that.success("修改成功",function (){
                                parent.getUserInfo()
                            })
                        })
                    }
                }
            })
            common.load(app,['icon','MuAvatarUpload','MuForm'])
            app.mount('#app')
        }
    }
    return Controller;
})